﻿<div class="widget widget-table">
    <div class="widget-header">
        <h3><i class="fa fa-table"></i> 订单打印</h3>
    </div>
    <div class="widget-content">
        <div class="row">
            <div class="col-sm-12 search-bar">
                <!--<div class="search-col">
                    <label class="search-label">打印类型：</label>
                    <select class="form-control search-control" ng-model="searchBar.type">
                        <option value="single">单包打印</option>
                        <option value="multi">多包打印</option>
                    </select>
                </div>-->
                <!--<div class="search-col">
                    <label class="search-label">渠道类型：</label>
                    <select class="form-control search-control"
                            ng-model="searchBar.channel"
                            ng-options="option.value as option.title for option in channelFilter"></select>
                </div>-->
                <!--<div class="search-col" style="float:right; margin-right:0px;">
                    <button class="btn btn-primary">确认打印</button>
                </div>-->
                <div class="search-col">
                    <label class="search-label">订单状态：</label>
                    <select class="form-control search-control" ng-model="searchBar.orderStatus">
                        <option value="">全部(不包括已删除)</option>
                        <option value="Unpaid">待支付</option>
                        <option value="Paid">已支付</option>
                        <option value="Processing">处理中</option>
                        <option value="Arrears">运费不足</option>
                        <option value="Shipped">已出库</option>
                        <option value="Void">已删除</option>
                    </select>
                </div>
                <div class="search-col">
                    <label class="search-label">打印状态：</label>
                    <select class="form-control search-control" 
                            ng-model="searchBar.printStatus">
                        <option value="">全部</option>
                        <option value="UnPrinted">待打印</option>
                        <option value="Printed">已打印</option>
                    </select>
                </div>
                <div class="search-col">
                    <label class="search-label">发货仓库：</label>
                    <select class="form-control search-control"
                            ng-model="searchBar.warehouseNumber"
                            ng-options="item.warehouseNumber as item.warehouseName for item in searchBar.warehouseList"></select>
                </div>
                <div class="clearfix"></div>
                <div class="search-col">
                    <label class="search-label">开始日期：</label>
                    <p class="input-group pull-left">
                        <input type="text" class="form-control search-control" style="width:110px;"
                               uib-datepicker-popup
                               ng-model="searchBar.startDate"
                               is-open="searchBar.opened.startDate"
                               show-button-bar="false"
                               ng-click="searchBar.opened.startDate = true" />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="searchBar.opened.startDate = true"><i class="fa fa-calendar"></i></button>
                        </span>
                    </p>
                    <div class="pull-left">
                        <label class="search-label">日</label>
                        <select class="form-control search-control" style="width:55px; padding-left: 5px;" ng-model="searchBar.startTime_HH">
                            <option value="0">00</option>
                            <option value="1">01</option>
                            <option value="2">02</option>
                            <option value="3">03</option>
                            <option value="4">04</option>
                            <option value="5">05</option>
                            <option value="6">06</option>
                            <option value="7">07</option>
                            <option value="8">08</option>
                            <option value="9">09</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="23">23</option>
                        </select>
                        <label class="search-label">时</label>
                        <input type="text" class="form-control search-control" style="width:45px;" maxlength="2" ng-model="searchBar.startTime_mm" />
                        <label class="search-label">分</label>
                        <input type="text" class="form-control search-control" style="width:45px;" maxlength="2" ng-model="searchBar.startTime_ss" />
                        <label class="search-label">秒</label>
                    </div>
                </div>
                <div class="search-col">
                    <label class="search-label">结束日期：</label>
                    <p class="input-group pull-left">
                        <input type="text" class="form-control search-control" style="width:110px;"
                               uib-datepicker-popup
                               ng-model="searchBar.endDate"
                               is-open="searchBar.opened.endDate"
                               show-button-bar="false"
                               ng-click="searchBar.opened.endDate = true" />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="searchBar.opened.endDate = true"><i class="fa fa-calendar"></i></button>
                        </span>
                    </p>
                    <div class="pull-left">
                        <label class="search-label">日</label>

                        <select class="form-control search-control" style="width:55px; padding-left: 5px;" ng-model="searchBar.endTime_HH">
                            <option value="0">00</option>
                            <option value="1">01</option>
                            <option value="2">02</option>
                            <option value="3">03</option>
                            <option value="4">04</option>
                            <option value="5">05</option>
                            <option value="6">06</option>
                            <option value="7">07</option>
                            <option value="8">08</option>
                            <option value="9">09</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="23">23</option>
                        </select>
                        <label class="search-label">时</label>
                        <input type="text" class="form-control search-control" style="width:45px;" maxlength="2" ng-model="searchBar.endTime_mm" />
                        <label class="search-label">分</label>
                        <input type="text" class="form-control search-control" style="width:45px;" maxlength="2" ng-model="searchBar.endTime_ss" />
                        <label class="search-label">秒</label>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="search-col">
                    <label class="search-label">搜索条目：</label>
                    <select class="form-control search-control" ng-model="searchBar.keywordType">
                        <option value="customerNumber">客户编号</option>
                        <option value="userName">客户ID</option>
                        <option value="orderNumber">订单编号</option>
                        <option value="outBoundTrackingNumber">包裹单号</option>
                        <option value="receiveidentity">客户标示</option>
                        <option value="referenceOrderNumber">客户关联号</option>
                        <option value="cnTrackingNumber">国内物流号</option>
                    </select>
                    <input type="text" class="form-control search-control" style="margin-left:5px; width:480px;" placeholder="请输入查询关键字" ng-model="searchBar.keywords" />
                    <button type="button" class="btn btn-primary" style="margin-left:5px;" ng-click="btnSearch()">搜索</button>
                </div>
            </div>
            <div class="col-sm-12 search-bar">
                <div class="search-col" style="margin-bottom: 0px;">
                    <label class="search-label">批打通道：</label>
                    <!--<select class="form-control search-control"
                            ng-model="searchBar.batchChannel"
                            ng-options="option.value as option.title for option in channelFilter"></select>-->
                    <button type="button" class="btn btn-primary role" data-role="35" style="margin-left:5px;" ng-click="btnPrintBatch('order')">批量打印订单</button>
                    <button type="button" class="btn btn-primary role" data-role="36" style="margin-left:5px;" ng-click="btnPrintBatch('flyingexpress')">批量打印翔通面单</button>
                    <button type="button" class="btn btn-primary role" data-role="37" style="margin-left:5px;" ng-click="btnPrintBatch('flyingexpress2')">批量打印翔通单据</button>
                    <button type="button" class="btn btn-primary role" data-role="38" style="margin-left:5px;" ng-click="btnPrintBatch('package')">批量打印发票</button>
                    <button type="button" class="btn btn-primary role" data-role="39" style="margin-left:5px;" ng-click="btnPrintBatch('trackingNumber')">批量打印包裹号</button>
                </div>
                <div class="search-col pull-right" style="margin-bottom: 0px; margin-right:0px;">
                    <button type="button" class="btn btn-primary role" data-role="40" style="margin-left:5px;" ng-click="btnPrintEmptyFlyingExpress()">打印空白翔通单据</button>
                </div>
            </div>
            <div class="col-sm-12 search-bar" style="margin-bottom: 0px;" ng-show="selectedListCache.length > 0">
                <div class="search-col" style="margin-bottom: 0px;">
                    <label class="search-label">已选择：{{selectedListCache.length}}个订单</label>
                    <button type="button" class="btn btn-link" ng-click="btnClearSelectedListCache();">清除已选项</button>
                </div>
            </div>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th><input type="checkbox" ng-change="btnSelectedItem()" ng-model="searchBar.selectedAll" /></th>
                <th>序号</th>
                <th>订单号</th>
                <th>生成日期</th>
                <th>客户编号</th>
                <th>客户ID</th>
                <th>标示</th>
                <th>包裹跟踪号</th>
                <th>打印状态</th>
                <th>订单状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in dataList">
                <td><input type="checkbox" ng-change="btnSelectedItem(item)" ng-model="item._selected" /></td>
                <td>{{item.rownumber}}</td>
                <td><a href="javascript:void(0);" ng-click="btnOpenDetail(item,'orderdetail')">{{item.orderNumber}}</a></td>
                <td>{{item.orderDate | date:'MM/dd/yyyy HH:mm:ss'}}</td>
                <td><a href="javascript:void(0);" ng-click="btnOpenDetail(item,'customerdetail')">{{item.customer.customerNumber}}</a></td>
                <td>{{item.customer.userName}}</td>
                <td>{{item.customer.receiveIdentity}}</td>
                <td style="max-width: 150px;"><div ng-repeat="pkg in item.outboundPackages">{{pkg.trackingNumber}}</div></td>
                <td>{{item._printStatus}}</td>
                <td>{{item._orderStatus}}</td>
                <td>
                    <a href="javascript:void(0)" class="role" data-role="41" ng-click="btnPrint(item,'order')">打印订单</a>
                    <a href="javascript:void(0)" class="role" data-role="42" ng-click="btnPrint(item,'flyingexpress')">打印翔通面单</a>
                    <a href="javascript:void(0)" class="role" data-role="43" ng-click="btnPrint(item,'flyingexpress2')">打印翔通单据</a>
                    <a href="javascript:void(0)" class="role" data-role="44" ng-click="btnPrint(item,'package')">打印发票</a>
                    <a href="javascript:void(0)" class="role" data-role="45" ng-click="btnPrint(item,'trackingNumber')">打印包裹号</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-sm-12 text-right">
            <uib-pagination class="pagination pagination-rewrite pull-right"
                            boundary-links="true"
                            max-size="5"
                            total-items="pagination.totalCount"
                            items-per-page="pagination.pageSize"
                            ng-model="pagination.pageIndex"
                            ng-change="getData()"
                            previous-text="上一页"
                            next-text="下一页"
                            first-text="首页"
                            last-text="尾页">
            </uib-pagination>
            <select class="form-control pull-right" style="width:70px;" ng-model="pagination.pageSize" ng-change="getData()">
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
            </select>
        </div>
    </div>
</div>
<print-order></print-order>
<print-package></print-package>
<print-flying-express></print-flying-express>
<print-flying-express2></print-flying-express2>
<print-flying-express-empty></print-flying-express-empty>